package com.student.client.controller;

import com.student.client.entity.Attendance;
import com.student.client.entity.Award;
import com.student.client.service.AwardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class AwardController {
    @Autowired
    private AwardService awardService;
    //查询所有奖励记录接口
    @RequestMapping("/award")
    public List<Award> getAward() {
        return awardService.findAllAward();
    }

    @PostMapping("/addAward")
    public Integer getAttendance(@RequestParam String award_id,
                                 @RequestParam String award_name,
                                 @RequestParam Integer award_count) {
        Award award = new Award(award_id,award_name,award_count);
        return awardService.addAward(award);
    }
}
